@extends('layouts.tankuang')

@section('content')
        <form name="add_form" id="add_form" action="{{url('admin/yjfk/add')}}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div id="div_print">
                <h2 class="text-center mg_b36 mg_t25" style="font-weight:bold;">意见反馈</h2>

                <table class="table-form table-border w mg-auto">
                    <tbody>
                    <tr>
                        <td class="font-bd" width="12%">单位名称</td>
                        <td colspan="5"><input type="text" class="form-input w" value="{{$units->name}}" name="dwmc" disabled></td>
                    </tr>

                     <tr>
                        <td class="font-bd">姓名</td>
                        <td>
                             <input type="text" class="form-input w easyui-validatebox" value="" name="jbr" data-options="required:true,missingMessage:'姓名不能为空',validateOnCreate:false,validateOnBlur:true">
                        </td>
                        <td class="font-bd">联系电话</td>
                        <td>
                            <input type="text" class="form-input w easyui-validatebox" value="" name="lxdh" data-options="required:true,validType:'phoneAndMobile',missingMessage:'请填写联系电话',invalidMessage:'请输入正确的联系电话',validateOnCreate:false,validateOnBlur:true">
                        </td>
                    </tr>
                    <tr>
                    	 <td class="font-bd">时间</td>
                         <td colspan="3">
                             <input class="easyui-datetimebox w153" value="" name="jbsj" disabled>
                        </td>
                    </tr>
                     <tr>
                        <td class="font-bd">意见</td>
                        <td colspan="3"><textarea  name="jbnr" class="textarea form-input w easyui-validatebox" data-options="required:true,missingMessage:'意见不能为空',validateOnCreate:false,validateOnBlur:true"></textarea></td>
                    </tr>
					<tr>
                    	<td>照片</td>
                    	<td colspan="3">
                    		<input type="file" name="pic" id="" value="" accept="image/gif,image/jpeg"/>
                    	</td>
                    </tr>



             

                    </tbody>
                </table>

            
                <div class="w wbt mg_t25 pd_b20 text-center">
                    <button id="go" type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-save'">确定</button>
                    <button type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-no'" onclick="$('#adbg').window('close')">关闭</button>
                </div>
            </div>
        </form>


        <script>
                $('#go').click(function (){
                	if(!$("#add_form").form('validate')){
					return false;
					}
                    var formData = new FormData($( "#add_form" )[0]);
                    $.ajax({
                        cache: true,
                        type: "POST",
                        url: "{{url('admin/yjfk/add')}}",
                        data: formData,
                        async: false,
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function(data) {
                            if(data.status == 1){
                                $.messager.alert('信息提示',data.msg,'info');
                                $('#adbg').dialog('close');
                                $('.pagination-load').click();
                            }else {
                                $.messager.alert('信息提示',data.msg,'info');
                            }
                        },
                        error: function(msg) {
                            var json=JSON.parse(msg.responseText);
                            $.each(json, function(index, value) {
                                $.messager.alert('信息提示',value,'info');die;
                            });
                        },
                    });
                });
        </script>



      

@stop